import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

class ModifyingAxisSize extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Row(
      // 决定row和column在主轴上占据多大空间：max、min
      // 若想使得元素紧密联系在一起，可设置为min
      mainAxisSize: MainAxisSize.min,
      // 主轴的对齐方式（和flex类似）：start、center、end、spaceBetween、spaceEvenly、spaceAround
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      // 附轴的对齐方式：start、center、end、stretch
      crossAxisAlignment: CrossAxisAlignment.stretch,
      children: [BlueBox(), BlueBox(), BlueBox()],
    );
  }
}

class BlueBox extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      width: 50,
      height: 50,
      decoration: BoxDecoration(color: Colors.red, border: Border.all()),
    );
  }
}
